package cn.com.open.itembank.dto;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by lucky on 2018/1/9.
 */
public class RuleSectionSaveModel extends RuleSectionModel {
    public RuleSectionSaveModel() {
        this.difficultyList = null;
    }

    /**
     * 难度数量分数设定（难→易）.
     */
    private List<RuleDifficultySaveModel> difficultyList;

    /**
     * Gets difficulty list.
     *
     * @return the difficulty list
     */
    public List<RuleDifficultySaveModel> getDifficultyList() {
        if (difficultyList == null) {
            difficultyList = new ArrayList<>();
        }
        return difficultyList;
    }

    /**
     * Copy to input rule section input model.
     *
     * @return the rule section input model
     */
    public RuleSectionInputModel copyToInput() {
        RuleSectionInputModel model = new RuleSectionInputModel();
        model.setSectionTitle(this.getSectionTitle());
        model.setShuffle(this.isShuffle());
        model.setQuestionTypeId(this.getQuestionTypeId());
        model.getExampleQuestion().addAll(this.getExampleQuestion());
        model.getMustQuestion().addAll(this.getMustQuestion());
        model.getInstruction().addAll(this.getInstruction());
        return model;
    }
}
